#!/bin/bash

useradd -r -s /usr/sbin/nologin -u $UID $NAME
echo -e "$PASSWD\n$PASSWD" | smbpasswd -a $NAME
unset UID NAME PASSWD
/etc/init.d/smbd start
/bin/bash
